package com.example.competitionregistration.mapper;

import com.example.competitionregistration.entity.InstructorAccount;
import com.example.competitionregistration.entity.InstructorInform;
import com.example.competitionregistration.entity.StudentAccount;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RegisterMapper {
    @Insert("insert into student_account (id,account,password,status) values (#{id},#{account},#{password},#{status})")
    void studentRegister(StudentAccount studentAccount);

    @Insert("insert into instructor_account (id,account,password,job_number,status) values (#{id},#{account},#{password},#{jobNumber},#{status})")
    void teacherRegister(InstructorAccount instructorAccount);

    @Select("select count(*) from student_account")
    int countStudent();

    @Select("select count(*) from instructor_account")
    int countTeacher();

    @Select("select * from instructor_inform where job_number=#{jobNumber}")
    InstructorInform findInstructorInform(InstructorInform instructorInform);

}